package com.coreJava.test02;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.Semaphore;

/**
 * 作者: LCG
 * 日期: 2019/9/3 17:00
 * 描述:
 */
public class TestBingFa {

    public static void main(String[] args) throws InterruptedException {

        /*CountDownLatch countDownLatch=new CountDownLatch(2);

        Thread thread1=new Thread(new MyCountDownRunable(countDownLatch),"A");
        thread1.start();
        Thread thread2=new Thread(new MyCountDownRunable(countDownLatch),"B");
        thread2.start();

        countDownLatch.await();

        System.out.println("=========主线程=======");*/

       /* CyclicBarrier cyclicBarrier=new CyclicBarrier(2, new Runnable() {
            @Override
            public void run() {
                System.out.println("========发令起跑=======");
            }
        });


        Thread thread1=new Thread(new MyCycRunable(cyclicBarrier,5),"A");
        thread1.start();
        Thread thread2=new Thread(new MyCycRunable(cyclicBarrier,8),"B");
        thread2.start();
        Thread thread3=new Thread(new MyCycRunable(cyclicBarrier,8),"C");
        thread3.start();
        Thread thread4=new Thread(new MyCycRunable(cyclicBarrier,6),"D");
        thread4.start();*/


       /* Semaphore semaphore=new Semaphore(1);

        Thread thread1=new Thread(new MySymphRunable(semaphore),"A");
        thread1.start();
        Thread thread2=new Thread(new MySymphRunable(semaphore),"B");
        thread2.start();
        Thread thread3=new Thread(new MySymphRunable(semaphore),"C");
        thread3.start();
        Thread thread4=new Thread(new MySymphRunable(semaphore),"D");
        thread4.start();*/


        //ConcurrentHashMap


    }

}
